# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-
# import uuid
# from datetime import datetime
#
# from com.chenxiaojie.dao.orm import Model, StringField, BooleanField, TextField
#
# """
# CREATE TABLE `_user` (
#   `_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
#   `id` char(32) NOT NULL DEFAULT '',
#   `email` char(32) NOT NULL DEFAULT '',
#   `passwd` varchar(64) NOT NULL DEFAULT '',
#   `admin` tinyint(4) NOT NULL DEFAULT '0',
#   `name` varchar(128) NOT NULL DEFAULT '',
#   `image` varchar(512) NOT NULL DEFAULT '',
#   `created_at` datetime NOT NULL DEFAULT '2018-12-12 00:00:00',
#   PRIMARY KEY (`_id`),
#   UNIQUE KEY `uni_id` (`id`)
# ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
# """
#
#
# class User(Model):
#     __table__ = '_user'
#
#     id = StringField(primary_key=True, default=lambda: uuid.uuid4().hex)
#     email = StringField()
#     passwd = StringField()
#     admin = BooleanField()
#     name = StringField()
#     image = StringField()
#     created_at = StringField(default=lambda: datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#
#
# """
# CREATE TABLE `_blog` (
#   `_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
#   `id` char(32) NOT NULL DEFAULT '',
#   `user_id` char(32) NOT NULL DEFAULT '',
#   `title` varchar(128) NOT NULL DEFAULT '',
#   `summary` varchar(512) NOT NULL DEFAULT '',
#   `content` text NOT NULL,
#   `created_at` datetime NOT NULL DEFAULT '2018-12-12 00:00:00',
#   PRIMARY KEY (`_id`),
#   UNIQUE KEY `uni_id` (`id`)
# ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
# """
#
#
# class Blog(Model):
#     __table__ = '_blog'
#
#     id = StringField(primary_key=True, default=lambda: uuid.uuid4().hex)
#     user_id = StringField()
#     name = StringField()
#     summary = StringField()
#     content = TextField()
#     created_at = StringField(default=lambda: datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#
#
# """
# CREATE TABLE `_reply` (
#   `_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
#   `id` char(32) NOT NULL DEFAULT '',
#   `blog_id` char(32) NOT NULL DEFAULT '',
#   `user_id` char(32) NOT NULL DEFAULT '',
#   `content` text NOT NULL,
#   `created_at` datetime NOT NULL DEFAULT '2018-12-12 00:00:00',
#   PRIMARY KEY (`_id`),
#   UNIQUE KEY `uni_id` (`id`)
# ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
# """
#
#
# class Reply(Model):
#     __table__ = '_reply'
#
#     id = StringField(primary_key=True, default=lambda: uuid.uuid4().hex)
#     blog_id = StringField()
#     user_id = StringField()
#     content = TextField()
#     created_at = StringField(default=lambda: datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
